<template>
  <div class="home">
    <header>
      <van-tabbar route :fixed="false">
        <van-tabbar-item
          replace
          :to="item.path"
          :icon="item.meta.icon"
          v-for="(item, index) in footbar"
          :key="index"
          >{{ item.meta.title }}</van-tabbar-item
        >
      </van-tabbar>
    </header>
    <main><router-view></router-view></main>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "Home",
  components: {},
  data() {
    return {
      footbar: [],
    };
  },
  created() {
    this.footbar = this.$router.getRoutes().filter((item) => item.meta.isflag);

  },
};
</script>
<style lang="scss">
.home {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;

  main {
    width: 80%;
    height: 100%;
    overflow-x: auto;
  }
  header {
    width: 15%;
    line-height: 100%;
    background: #ccc;
    color: #fff;
    .van-tabbar--unfit {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      background: none;
      color: rgb(236, 225, 225);
      
      .van-tabbar-item{
         width: 100%;
         height: 100px;
         display: flex;
         flex-direction: row;
         justify-content: space-around;

      }
      
    }
  }
}
</style>